#ifndef OHOS_SHARING_WFD_SOURCE_LISTENER_MANAGER_H
#define OHOS_SHARING_WFD_SOURCE_LISTENER_MANAGER_H

#include "wfd_callback_napi.h"

namespace OHOS {
namespace Sharing {
  class WfdSourceListenerManager {
    public:
      // 删除拷贝构造函数和赋值操作符，防止复制单例实例
      WfdSourceListenerManager(const WfdSourceListenerManager&) = delete;
      WfdSourceListenerManager& operator=(const WfdSourceListenerManager&) = delete;

      // 提供全局访问点
      static WfdSourceListenerManager& getInstance() {
        static WfdSourceListenerManager instance;
        return instance;
      }

      // 获取WfdSource的shared_ptr
      std::shared_ptr<WfdCallbackNapi>& getWfdSourceListener() {
        return wfdSourceListener_;
      }

    private:
      // 私有构造函数
      WfdSourceListenerManager() {}

      // 持有 WfdCallbackNapi 的shared_ptr
      std::shared_ptr<WfdCallbackNapi> wfdSourceListener_;
  };   
} // namespace Sharing
} // namespace OHOS
#endif